The present invention relates generally to the field of inter-process communication across a computer network, and more particularly to creating and managing the storing and retrieving of network socket descriptors to dynamically switch protocols during data communication.
Transmission control protocol (TCP) is a core protocol of the Internet Protocol suite that provides a reliable, point-to-point communication channel between client-server applications on the Internet in order to communicate. To communicate over TCP, a client program and a server program establish a connection to one another through network sockets. A socket is one endpoint of a two-way communication link between two programs running on the network. Sockets are implemented by an application programming interface provided by the operating system that allows application programs to control and use network sockets generally based on the Berkeley sockets standard, which identifies socket API functions, such as create, close, connect, bind, accept, read, and write. Sockets are characterized by at least a local socket address and a transport protocol (e.g., user datagram protocol, TCP, raw sockets) and are bound to a port number so that the TCP layer can identify the applications that data is to be sent to. TCP connections can be uniquely identified by the two endpoints (i.e., unique combination of a port number and Internet Protocol address) and may be capable of allowing multiple connections between the client and the server.
Computer processes that provide application services are servers that create sockets at start up that are in a listen state, waiting for initiatives from client programs. For example, a server operates on a specific computer and binds a socket to a specific port number that the server then monitors for a connection request from a client. The hostname of the specific computer on which the server operates upon and the port number the server monitors are known by the client. Hostnames are human-readable nicknames, such as a domain name, that corresponds to the Internet Protocol address of a device connected to a network. To make a connection request, the client attempts to establish a connection with the server via the monitored port number and identifies a bound local port number associated with the client for use during the connection. Upon acceptance, the server may bind a new socket to the same local port and sets a remote endpoint to the address and port of the client, or the server may bind a new socket to a different port. The server utilizes the new socket in order to continue monitoring the original socket for other connection requests while the server utilizes the established connection to tend to the needs of the connected client. When the connection is accepted, a socket is successfully created, and the client can then use the socket to communicate with the server by writing to or reading from the connected sockets.